package com.shtel.bss.saas.tenant.entity;

import java.util.Date;
import com.shtel.bss.saas.core.data.common.entiry.IAbsBaseEntity;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import com.shtel.bss.saas.core.base.spring.ApplicationContextUtil;
import com.shtel.bss.saas.tenant.entity.repository.ISysOrganizationUserJoinRepository;

/**
 * 组织用户关系表
 * @author xiezhiwei 2020-02-05 21:09
 */
@Table(name = "SYS_ORGANIZATION_USER_JOIN")
public class SysOrganizationUserJoin extends IAbsBaseEntity<Long> {
	
    /**
     * 创建时间
     * 
     */
	@Column(name = "CREATE_TIME")
	private Date createTime;
    /**
     * 创建人
     * 
     */
	@Column(name = "CREATE_USER_ID")
	private Long createUserId;
    /**
     * 组织ID
     * 
     */
	@Column(name = "ORG_ID")
	private Long orgId;
    /**
     * 组织用户关系ID
     * 
     */
	@Id
	@Column(name = "ORG_USER_ID")
	private Long orgUserId;
    /**
     * 租户ID
     * 
     */
	@Column(name = "TENANT_ID")
	private Long tenantId;
    /**
     * 用户ID
     * 
     */
	@Column(name = "USER_ID")
	private Long userId;

	public static ISysOrganizationUserJoinRepository repository() {
		return (ISysOrganizationUserJoinRepository) ApplicationContextUtil.getBean("sysOrganizationUserJoinRepository");
	}
	
    public void setCreateTime(Date createTime) {
    	this.createTime = createTime;
    }
    
    public Date getCreateTime() {
	   return createTime;
    }
    
    public void setCreateUserId(Long createUserId) {
    	this.createUserId = createUserId;
    }
    
    public Long getCreateUserId() {
	   return createUserId;
    }
    
    public void setOrgId(Long orgId) {
    	this.orgId = orgId;
    }
    
    public Long getOrgId() {
	   return orgId;
    }
    
    public void setOrgUserId(Long orgUserId) {
    	this.orgUserId = orgUserId;
    }
    
    public Long getOrgUserId() {
	   return orgUserId;
    }
    
    public void setTenantId(Long tenantId) {
    	this.tenantId = tenantId;
    }
    
    public Long getTenantId() {
	   return tenantId;
    }
    
    public void setUserId(Long userId) {
    	this.userId = userId;
    }
    
    public Long getUserId() {
	   return userId;
    }
    
	@Override
	public Long getId() {
		return getOrgUserId();
	}

	@Override
	public void setId(Long id) {
		setOrgUserId(id);
	}
}